# coding=utf-8
# -*- coding: UTF-8 -*-
#
# This file is part of the kernelstudio package.
#
# (c) 2014-2023 zlin <admin@kernelstudio.com>
#
# For the full copyright and license information, please view the LICENSE file
# that was distributed with this source code.
from typing import Any

from ksai.context import ApplicationInitializer, Application
from ksai.persistence.database import DatabasePersistenceInitializer
from ksai.persistence.redis import RedisPersistenceInitializer
from ksai.persistence.storage import StoragePersistenceInitializer


class PersistenceInitializer(ApplicationInitializer):

    def initialize(self, app: Application) -> Any:
        initializers = [
            DatabasePersistenceInitializer(),
            RedisPersistenceInitializer(),
            StoragePersistenceInitializer(),
        ]
        for initializer in initializers:
            initializer.initialize(app)
